<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#abc span{ float:left;}
</style>
</head>
<body> 
<%@ include file="common.jsp" %>
<div style="margin:0 auto; width:990px;">
<p style="margin:10px 0 10px 0">亲爱的<span style="color:#c22;">${loginUser.name }</span>用户您好.
您购买的商品有：</p>
</div>

<table id="tab" width="1100" border="1" cellspacing="0" cellpadding="0" style="margin:0 auto; text-align: center;border:1px solid #F00;">
<tr><td>序号</td><td>价钱</td><td>图片</td><td>操作</td></tr>
<c:forEach items="${cartlist}" var="m">
<tr>
	<td>${m.number }</td><td>${m.price }</td>
	<td><img src="img_shop/${m.url }" style="width:90px; height:90px;  " />
	</td>
	<td><a onclick="return confirm('您是否移除此商品?')"  href="ShoppingCartServlet?m=del&Url=${m.url }" style="color:#222;">删除</a ><br><a href="UserServlet" style="color:#222;">返回继续购物</a ></td>
</tr>
</c:forEach>

</table>


<div style="margin:0 auto; width:990px; height:50px;">
总价格：&nbsp;<h3 id="aaa" ></h3>
<form action="SuccessServlet?m=gouwu" method="post" >
	<input type="hidden" value="${loginUser.loginId }" name="Id"/>
	<input type="submit" value="提交订单" style="width:180px ;height:50px; float:right; margin-top:6px; font-size:20px;">
	<a href="UserServlet"><input type="button" value="继续购物" style="width:180px ;height:50px; float:right; margin-top:6px; font-size:20px;"></a>
</form>
</div>
<script>
var sum   = 0;
var table = document.getElementById("tab");
for(var i=1;i<table.rows.length;i++){
sum += parseFloat(table.rows[i].cells[1].innerText);
}
document.getElementById("aaa").innerHTML=sum;

</script>
<%@ include file="footer.jsp" %>
</body>
</html>